﻿@model IEnumerable<GameStore2.Models.GameCompany>

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>
@if (User.Identity.Name == "ahmedbilal") { 
    <p>
        @Html.ActionLink("Create New", "Create")
    </p>
}
<table>
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.Name)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.Name)
        </td>
        <td>@Html.ActionLink("Details", "Details", new { id = item.GameCompanyId })
        @if(User.Identity.Name == "ahmedbilal")
        {        <text>|</text>
                @Html.ActionLink("Edit", "Edit", new { id=item.GameCompanyId }) <text>|</text>
                @Html.ActionLink("Delete", "Delete", new { id=item.GameCompanyId })
        }
        </td>
    </tr>
}

</table>
